﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;

namespace WebApplicationExtNet
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [DirectMethod]
        public void Gravar()
        {
            using (dbEntities db = new dbEntities())
            {
                USUARIO usu = new USUARIO();

                //usu.Id = Convert.ToInt32(txtID.Text);
                usu.NOME        = txtNome.Text;
                usu.SOBRENOME   = txtSobreNome.Text;
                usu.CPF = Convert.ToInt32(txtCPF.Text);
                usu.DT_NASCIMENTO = Convert.ToDateTime(txtDataNascimento.Text);

                db.USUARIO.AddObject(usu);
                db.SaveChanges();
            }
        }
    }
}